package day06;
public class Cube {

    private int l;
    private int w;

    public Cube() {
    }

    public Cube(int l, int w) {
        this.l = l;
        this.w = w;
    }

    public void setL(int l) {
        this.l = l;
    }

    public int getL() {
        return l;
    }

    public void setW(int w) {
        this.w = w;
    }

    public int getW() {
        return w;
    }

    public int zhouChang() {
        return (l + w) * 2;
    }

    public int area() {
        return l * w;
    }
}

class CubeTest {
    public static void main(String[] args) {
        // 无参
        Cube cube = new Cube();
        cube.setL(10);
        cube.setW(20);
        System.out.println(cube.zhouChang());;
        System.out.println(cube.area());;

        // 带参
        Cube cube2 = new Cube(10, 20);
        System.out.println(cube2.zhouChang());;
        System.out.println(cube2.area());;
    }
}
